package com.yt.server.api.action;

import java.util.Set;

import com.yt.server.api.IScope;

/**
 * 动作行为接口
 */
public interface IActionCall {
	public static final byte STATUS_PENDING = 0x01;
	public static final byte STATUS_SUCCESS_RESULT = 0x02;
	public static final byte STATUS_SUCCESS_NULL = 0x03;
	public static final byte STATUS_SUCCESS_VOID = 0x04;
	public static final byte STATUS_SERVICE_NOT_FOUND = 0x10;
	public static final byte STATUS_METHOD_NOT_FOUND = 0x11;
	public static final byte STATUS_ACCESS_DENIED = 0x12;
	public static final byte STATUS_INVOCATION_EXCEPTION = 0x13;
	public static final byte STATUS_GENERAL_EXCEPTION = 0x14;
	public static final byte STATUS_APP_SHUTTING_DOWN = 0x15;
	public static final byte STATUS_NOT_CONNECTED = 0x20;

	public abstract String getId();

	public abstract IScope getScope();

	public abstract boolean isSuccess();

	public abstract Object getResult();

	public abstract Object getResultPacket();

	public abstract void setResult(Object result);

	public abstract String getActionMethodName();

	public abstract String getActionName();

	public abstract Object[] getArguments();

	public abstract byte getStatus();

	public abstract Exception getException();

	public abstract void setStatus(byte status);

	public Set<IActionCallback> getCallbacks();

	/**
	 * 注册多个回调函数
	 * 
	 * @param callback
	 */
	public void registerCallback(IActionCallback callback);

	public abstract void setException(Exception exception);
}